﻿/**
*	Point3D
*	@author 	Liam O'Donnell 2008-03-28
**/

package com.spikything.pants3d.core {
	
	import com.spikything.pants3d.objects.IRenderable;
	
	public class Point3D implements IRenderable {

		public var x 		:Number;	// X position
		public var y 		:Number;	// Y position
		public var z 		:Number;	// Z position
		public var vx		:Number;	// X speed
		public var vy		:Number;	// Y speed
		public var vz		:Number;	// Z speed

		public function Point3D (x:Number, y:Number, z:Number) {
			px = x;
			py = y;
			pz = z;
			vx = 0;
			vy = 0;
			vz = 0;
		}
		
		public function toString ():String { return "Point3D" }; 
		public function get id ():String { return toString() };
		public function get isCollidable ():Boolean { return false };
		
		public function get px ():Number { return x };
		public function get py ():Number { return y };
		public function get pz ():Number { return z };
		public function set px (x:Number):void { this.x = x };
		public function set py (y:Number):void { this.y = y };
		public function set pz (z:Number):void { this.z = z };
		
		public function update ():void {
			px += vx;
			py += vy;
			pz += vz;
		}

		public function impulse (ix:Number, iy:Number, iz:Number):void {
			vx += ix;
			vy += iy;
			vz += iz;
		}

		public function setVelocities (ix:Number, iy:Number, iz:Number):void {
			vx = ix;
			vy = iy;
			vz = iz;
		}

		public function setPos (ix:Number, iy:Number, iz:Number):void {
			px = ix;
			py = iy;
			pz = iz;
		}

	}
	
}